﻿<Window x:Class="DemoApp.PopupListWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Component List" 
        SizeToContent="WidthAndHeight"
        WindowStartupLocation="CenterOwner"
        x:Name="theList">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="350" />
        </Grid.ColumnDefinitions>

        <ListView Grid.Row ="0" 
                  ItemsSource="{DynamicResource ComponentList}"
                  SelectedIndex="0" Name="lvComponentList"
                  SelectionChanged="lvComponentList_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="ID"
                            DisplayMemberBinding="{Binding Key}" />
                    <GridViewColumn Header="Component Name"
                            DisplayMemberBinding="{Binding Value}" />
                </GridView>
            </ListView.View>
        </ListView>
        <ListView Grid.Row ="1" 
                  SelectedIndex="0" Name="lvMethodList">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Method Name"
                            DisplayMemberBinding="{Binding}" />
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.Row="2"
                    Orientation="Horizontal"
                    HorizontalAlignment="Center">
            <Button Content="Load"
                    Click="Load_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
            <Button Content="Execute"
                    Click="Execute_Click"
                    Margin="5"
                    Width="100"
                    Height="30" />
            <Button Content="Cancel"
                    IsCancel="True"
                    Margin="5"
                    Width="100"
                    Height="30" />
        </StackPanel>
    </Grid>
</Window>
